<template>
  <div>

    <el-dialog title="添加App管理者" :visible.sync="dialogVisible" @close="closeEdit(false)" width="800px">
      <el-form :model="supermanForm" ref="supermanForm" label-width="120px" style="width: 90%;">

        <el-row :gutter="40">
          <el-col :span="24">

            <el-form-item 
              label="手机号" 
              prop="phone"
              >
              <el-input v-model="supermanForm.phone" ></el-input>
            </el-form-item>

          </el-col>
        </el-row>

        

      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button @click="closeEdit(false)">取 消</el-button>
        <SubmitButton type="primary" size="" :ref-form="()=>{return this.$refs['supermanForm']}" :post-option="{url: addUrl, data: supermanForm, callback: checkCB }">
          保存
        </SubmitButton>
      </div>

    </el-dialog>

  </div>
  
</template>


<script>

  import SubmitButton from '../common/SubmitButton'

  import CommonApi from '../../api/CommonApi'
  import SupermanApi from '../../api/SupermanApi'
  

  export default {
    components: {
      SubmitButton
    },
    data(){
      return {
        
        supermanForm: {
          phone: '',
        },

        addUrl: SupermanApi.URL_ADD,
      }
    },
    props: ['isShow'],
    computed: {
      dialogVisible: {
        get: function(){
          return this.isShow;  
        },
        set: function(val){}
      }
    },
    created(){
    },
    methods: {
      checkCB(json){
        this.closeEdit(true);
      },
      closeEdit(isSuccess){
        this.$refs['supermanForm'].resetFields();
        this.$root.eventHub.$emit('closeEditDialog', isSuccess);
      }
    }
  }
</script>

